project(Demo)

set(QT_CPP_ROOTDIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_PREFIX_PATH "${QT_CPP_ROOTDIR}/3rdParty/qt")
set(Qt5_DIR "${QT_CPP_ROOTDIR}/3rdParty/qt/lib/cmake/lib")
set(ASSERTS_DIR "${QT_CPP_ROOTDIR}/asserts")
set(CMAKE_AUTOMOC ON)

find_package(Qt5 COMPONENTS Widgets Core Gui Multimedia Network REQUIRED)


set(PLUGIN_DIR "${QT_CPP_ROOTDIR}/3rdParty/qt/plugins")
file(GLOB PLUGIN_SUBDIRECTORIES RELATIVE "${PLUGIN_DIR}" "${PLUGIN_DIR}/*")
foreach(subdirectory ${PLUGIN_SUBDIRECTORIES})
    file(COPY "${PLUGIN_DIR}/${subdirectory}" DESTINATION "${CMAKE_BINARY_DIR}/bin/")
endforeach()
file(COPY "${ASSERTS_DIR}" DESTINATION ${CMAKE_BINARY_DIR}/bin/)


add_subdirectory(code)